package org.smog.core.config.security;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description: Created by IntelliJ IDEA.
 * @project_name: smogTemp
 * @time: 2020-05-14 11:22
 * @email: 17685306043@163.com
 * @author: huangZhongYao
 */
@Slf4j
@Component
@AllArgsConstructor
public class SecurityConstant {


    /**
     * 无权限code
     */
    public static final int FORBIDDEN_CODE = 403;
    /**
     * 未认证code
     */
    public static final int UNAUTHORIZED_CODE = 401;
    /**
     * 用户友好异常code
     */
    public static final int USER_FRIENDLY_CODE = 600;
    /**
     * 认证失败异常code
     */
    public static final int AUTH_INVALID_FRIENDLY_CODE =406;
    /**
     * 认证失效
     */
    public static final int AUTH_EXPIRED_FRIENDLY =407;
    /**
     * 未登录异常code
     */
    public static final int NOT_LOGIN_CODE = 408;
    /**
     * 角色基类
     */
    public interface BaseRole {
        String BASE_PREFIX = "ROLE_";
    }

    /**
     * 角色
     */
    public static class Role implements BaseRole {
        /**
         * 管理员
         */
        public static final String ADMIN = BASE_PREFIX + "ADMIN";
    }
}
